<?php
/****
 * 沧海接口
 *
 * @author: qingkuangs(qingkuangs@gmail.com)
 * @date  : 2011-05-04
 *
****/
include(dirname(__FILE__)."/global.php");
include(INCLUDE_PATH . "/common/common.func.php");
include(INCLUDE_PATH . "/common/php_redis.class.php");

$passport_key	= SERVER_KEY;
$rurl			= MAIN_DOMAIN_URL;
$timeExpire		= 300;

define("IN_PASSPORT",1);

if(isset($_GET["action"]) && isset($_GET["auth"]) && isset($_GET["verify"])) {
	$strAction		= $_GET["action"];
	$strAuth		= $_GET["auth"];
	$strVerify		= $_GET["verify"];

	$strBase64Auth = base64_decode($strAuth);
	$arrTmp = explode("&",$strBase64Auth);

	$iDataLen = count($arrTmp);

	$arrData = array();
	for($i = 0,$len = $iDataLen;$i < $len;$i++) {
		$tmp = explode("=",$arrTmp[$i]);
		if($tmp) {
			$arrData[$tmp[0]] = (isset($tmp[1])) ? trim($tmp[1]) : "";
		}
	}
	
	switch($strAction) {
		case "login"://登录
			require(PROJECT_ROOT . "/action/login.php");
			break;
		case "charge"://付费
			require(PROJECT_ROOT . "/action/charge.php");
			break;
		case "uinfo"://用户信息
			require(PROJECT_ROOT . "/action/uinfo.php");
			break;

	}

	unset($arrData);
	exit;
}
echo "<meta http-equiv=refresh content='0; url=".$rurl."'>";
?>